/*
 * Copyright 2025 The Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *@file    : so2.h
 *@brief   : so2 header 
 *@authors : zhanglei, zhanglei_723@126.com
 *@version : v1.0
 *@data    : 2025/8/24
 *
 */

#ifndef SO2_H
#define SO2_H

#include <cmath>
#include <Eigen/Dense>

#include "common/type.h"

using namespace std;
using namespace Eigen;

class SO2 {
public:
	SO2();
	SO2(const double& t);
	SO2(const SO2& other);
    SO2 operator*(SO2& other) const;
    SO2 operator*(const SO2& other) const;
    SO2 operator-(const SO2& other) const;
    // SO2 operator+=(SO2& other) const;
	Eigen::Matrix2d matrix();
	Eigen::Matrix3d matrix3d();
	static Eigen::Matrix2d Exp(const double& t);
	static double exp(const Eigen::Matrix2d& R);
	static SO2 exp(const double& t);
	double inv();
	Eigen::Matrix2d inverse();
	double log();
	Eigen::Matrix2d so2();
	static Eigen::Matrix2d so2(const double& v);
	
	static double Normalize(const double &t);

private:
	double t_;
};

#endif
